import React, { useContext, useMemo } from 'react'
import AppContext from './context'

const B: React.FC = () => {
	const { state, dispatch }: any = useContext(AppContext)
	console.log('useContext/b.tsx...', state)
	return useMemo(() => {
		return (
			<div>
				B =&gt; 名字:
				<button onClick={() => dispatch('add')}>
					countB++ =&gt; {state.count}
				</button>
			</div>
		)
	}, [state.count, dispatch])
}
export default B
